Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust CPU frequency scaling on desktop to run in "performance" governor #162

Merged
merged 2 commits into from Feb 2, 2021
Merged

Conversation

ThePoorPilot
Copy link
Contributor

@ThePoorPilot ThePoorPilot commented Feb 2, 2021

This is an updated version of the commit submitted by @librewish | PR: #158 (Fixes #127)

If it detects the device is a laptop, it should default to the regular method of determining ac_state
If the device returns any other output, it should default to ac_state=true

This is my first commit on github ever. I still don't really know much about programming, but with some research, I figured it out.
Couldn't fully test it because I had difficulty running it on arch(Garuda Linux), but I think this should work in theory.

Please test it out on your thinkpad or use your more coding-oriented brain to weed out obvious problems. I got it to compile with no errors and I could run the command "auto-cpufreq", but couldn't get it to run as a system daemon.

Also, sorry if this pull request is not done exactly properly, I am not very familiar with github

If it detects the device is a laptop, it should default to the regular method of determining ac_state
If the device returns any other output, it should default to ac_state=true

This is my first commit on github ever. I still don't really know much about programming, but with some research, I figured it out.
Couldn't fully test it because I had difficulty compiling on arch, but I think this should work in theory.
@ThePoorPilot ThePoorPilot changed the title added Chasis detection for ac_state added chassis detection for ac_state Feb 2, 2021
@AdnanHodzic AdnanHodzic changed the title added chassis detection for ac_state Adjust CPU frequency scaling on desktop to run in "performance" governor Feb 2, 2021
@AdnanHodzic
Copy link
Owner

AdnanHodzic commented Feb 2, 2021

@ThePoorPilot you did a great job for your first PR and I'm glad you did it for auto-cpufreq :)

Change LGTM now. Since you made these changes based on @Librewish I'll make sure credit you both in release notes for 1.5.4. which will be released later on today or tomorrow.

Thank you for both for your contribution!

@AdnanHodzic AdnanHodzic merged commit fc56e2a into AdnanHodzic:master Feb 2, 2021
AdnanHodzic added a commit that referenced this pull request Feb 3, 2021
@AdnanHodzic
Copy link
Owner

@ThePoorPilot @librewish there's a problem with using hostnamectl as it would require me to request additional automatically connected interface as part of Snap package. Hence, instead of reverting these changes, could one of you please make a new PR to use dmidecode --string chassis-type instead of hostnamectl?

I would've made changes myself but not sure what it should return if you run it on a desktop. Running dmidecode --string chassis-type returns "Notebook" for me.

@ghost
Copy link

ghost commented Feb 3, 2021

Returns "Desktop" for me

@AdnanHodzic
Copy link
Owner

@librewish could you please make a PR with these changes?

If it's not too much to ask to also update auto-cpufreq-installer to also install dmidecode as part of dependencies for Manjaro/Arch? You're also welcome to add it for all other distros, otherwise I can do this part.

After which I could make necessary Snap package changes and we could go ahead with 1.5.4 release.

@crian @yochananmarqos could one of you please add dmidecode as a dependency for auto-cpufreq AUR package before this release is made?

@crian
Copy link

crian commented Feb 4, 2021

@AdnanHodzic updated to the latest with the new dep.

@AdnanHodzic
Copy link
Owner

@AdnanHodzic updated to the latest with the new dep.

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPU frequency doesn't automatically adjust
3 participants